$(async function () {
    // 图片的基准地址
    const img_host='http://localhost:8081'

    // 1.获取分类数据
    const cates = await axios.get('api/home/cates')
    const catesHtml = template('catesTpl', {
        cates
    })
    $('#nav ul').html(catesHtml)

    // 2.获取图片新闻
    const imgsData = await axios.get('api/home/getImgNews')
    const imgsHtml = template('imgsTpl', {
        imgsData,
        img_host
    })
    $('#main1 ul').html(imgsHtml)

    // 3.获取最新新闻
     const newNewsData = await axios.get('api/home/getNewNews')
     const newNewsHtml = template('newNewsTpl', {
         newNewsData
     })
     $('.new-news').html(newNewsHtml)
      // 4.获取最热新闻
      const hotNewsData = await axios.get('api/home/getHotNews')
      const hotNewsHtml = template('hotNewsTpl', {
          hotNewsData
      })
      $('.hot-news').html(hotNewsHtml)

})